home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import java.io.DataInputStream;
-
- public class CGraphicsAction extends CDisplayAction {
- protected CPicture m_Picture = new CPicture();
- protected int m_nFlags;
- private CRect m_rcOffset = new CRect();
-
- void DrawObject(Graphics var1, int var2, CRect var3) {
- this.m_Picture.Draw(var1, var3);
- }
-
- boolean LoadFromFile(DataInputStream var1) {
- FileLoad.ReadCPlusShort(var1);
- this.m_nFlags = FileLoad.ReadCPlusInt(var1);
- this.m_Picture.LoadFromFile(var1);
- return super.LoadFromFile(var1);
- }
-
- public CGraphicsAction() {
- super(10);
- }
-
- boolean DoAction() {
- boolean var1 = false;
- new Dimension();
- if (!this.m_Picture.HasImageLoaded()) {
- var1 = true;
- }
-
- Dimension var2;
- if ((var2 = this.m_Picture.LoadImage()) != null) {
- CRect var3 = ((CDisplayAction)this).GetActualRect();
- if ((this.m_nFlags & 'ΦÇÇ') != 0) {
- Globals.thePresView.CanRemoveDrawObjects(var3, (CAction)this);
- }
-
- if ((this.m_Picture.m_nFlags & 2048) == 0) {
- var3.width = Math.min(var3.width, var2.width);
- var3.height = Math.min(var3.height, var2.height);
- }
-
- if (!((Rectangle)var3).equals(((CDisplayAction)this).GetDrawRect())) {
- if (!((CDisplayAction)this).GetDrawRect().isEmpty()) {
- Globals.thePresView.InvalidateOffScreenRect(((CDisplayAction)this).GetDrawRect());
- }
-
- ((CDisplayAction)this).SetDrawRect(var3);
- var1 = true;
- }
- }
-
- if (this.m_rcOffset.x != this.m_Picture.m_rcSource.GetRect().x || this.m_rcOffset.y != this.m_Picture.m_rcSource.GetRect().y) {
- this.m_rcOffset.reshape(this.m_Picture.m_rcSource.GetRect());
- var1 = true;
- }
-
- if (super.m_Effect.HasValidEffect()) {
- if ((this.m_nFlags & 'ΦÇÇ') != 0) {
- Globals.thePresView.AddDrawObject((CIconObject)this, 6144, var1);
- } else {
- Globals.thePresView.RenderAndDrawDirtyList();
- Globals.thePresView.AddDrawObject((CIconObject)this, 2048, var1);
- }
- } else {
- Globals.thePresView.AddDrawObject((CIconObject)this, 0, var1);
- }
-
- return true;
- }
- }
-